# coding:utf-8
import pymysql

db = pymysql.connect("localhost", "root", "boyun2017", "py_mysql")
cursor = db.cursor()
sql = """INSERT INTO 
          employee(first_name,last_name,age,sex,income)
          VALUE ('Max','Joh',30,'M',30)"""

try:
    cursor.execute(sql)
    db.commit()
except:
    db.rollback()

db.close()
